package com.bsoft.rpc.basic.dynamicProxy;

import lombok.extern.slf4j.Slf4j;

/**
 * 模拟网络远程通信
 */
@Slf4j
public class NetTransport {

    public static  <T> T sendRequest(RpcRequest request, Class<T> responseType) {
        log.info("连接到目标远程地址 --> {}:{}", request.getAddress(), request.getPort());
        log.info("请求接口信息 --> serviceName:{},methodName:{},paramTypes:{},params:{}", request.getServiceName(), request.getMethodName(), request.getParamsType(), request.getParams());
        log.info("服务端响应接口数据 。。。");

        return (T) new OrgInfo((String) request.getParams()[0], "浙医二院");
    }
}
